<?php echo $this->doctype('XHTML1_STRICT'); ?>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<?php 
$this->headMeta()->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
                 ->appendHttpEquiv('Content-Language', 'en-US');             
                 
echo $this->headMeta() . "\n";
$this->headTitle('YouTube Slide');

echo "\n";
     
echo $this->headTitle() . "\n\n";

$height = $this->screenHeight;
$width  = $this->screenWidth;

?>

<style>

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #000;
}

body {
    overflow: hidden;
}

</style>

<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>/public/scripts/swfobject.js"></script>

<script type="text/javascript">

var ytplayer = undefined;

function onShow(msg) {
    if (ytplayer != undefined) {
       ytplayer.playVideo();
    }
}
    
function onHide(msg ) {
    if (ytplayer != undefined) {
       ytplayer.pauseVideo();
    }
}

function init() {
	var flashvars = { };
    var params = { wmode: 'transparent', allowScriptAccess: "always" };
    var atts = { id: "thisYtPlayer" };
    swfobject.embedSWF("http://www.youtube.com/apiplayer?enablejsapi=1&playerapiid=ytplayer", 
                       "ytApiPlayer", <?php echo $width; ?>, <?php echo $height; ?>, "8", null, flashvars, params, atts);
}

function onYouTubePlayerReady(playerId) {
    ytplayer = document.getElementById("thisYtPlayer");
    ytplayer.loadVideoById('<?php echo $this->videoId; ?>', parseInt(0));
    //ytplayer.pauseVideo();
    ytplayer.setVolume(<?php echo $this->volume; ?>);
    <?php if ($this->mute) : ?>
    ytplayer.mute();
    <?php endif; ?>
}

</script>

</head>
<body>

<div style="text-align: center; height: <?php echo $height; ?>px; width: <?php echo $width; ?>px;">

<div id="ytApiPlayer">
   You need Flash player 8+ and JavaScript enabled to view this video.
</div>

</div>
</body>
</html>